package com.luca.sl651server.server.config;

import com.luca.sl651server.biz.service.BizService;
import com.luca.sl651server.server.codec.FrameBodyDecoder;
import com.luca.sl651server.server.codec.FrameEncoder;
import com.luca.sl651server.server.codec.FrameHeaderDecoder;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@ConfigurationProperties(prefix = "sl651")
@Component
@Data
public class NettyServerConfig {

//    @Value("${server_socket_ip:127.0.0.1}")
    private String serverSocketIp;

//    @Value("${server_socket_port:11112}")
    private int serverSocketPort;

//    @Value("${crc_verify_flag:false}")
    private boolean crcVerifyFlag;

//    @Value("${header_delimiter_flag:false}")
    private boolean headerDelimiterFlag;

//    @Value("${netty_so_backlog:50}")
    private int nettySoBackLog;

    private String serverRunMode;

    @Resource
    private FrameHeaderDecoder headerDecoder;
    @Resource
    private FrameBodyDecoder bodyDecoder;
    @Resource
    private BizService bizService;
    @Resource
    private FrameEncoder frameEncoder;
}
